﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using PloobsEngine.Utils;

namespace Etapa1.SofRender
{
    public class QuadShader : SEffect,PixelShader,VertexShader
    {
        public QuadShader()
        {
            this.GeometricShader = null;
            this.PixelShader = this;
            this.VertexShader = this;
        }        
        #region VertexShader Members

        VertexType VertexShader.VertexShader(VertexType vertice)
        {
            Vector4 pos = vertice[Slots.POSITION0];
            VertexType output = new VertexType();
            output[Slots.POSITION0] = pos;
            output[Slots.TEXTCOORD0] = StaticRandom.RandomColor().ToVector4();            
            return output;
        }

        #endregion

        #region PixelShader Members

        Color PixelShader.PixelShader(VertexType vo)
        {            
            return new Color(vo[Slots.TEXTCOORD0]);            
        }

        #endregion
    }
}
